<?php
namespace Index\ViewModel;
use Think\Model\ViewModel;

Class ReportreplyViewModel extends ViewModel {
    protected $connection = 'DB';   //连接数据库
    protected $viewFields = array(
        //舉報反饋表
        'chat_complaint_re' => ['id','complaint_id','admin_id', 'content', 'ctime', 'complaint_user_uid', '_type' => 'left'],
        //用户表
        'chat_userinfo' => ['username', '_on' => 'chat_complaint_re.complaint_user_uid = chat_userinfo.user_id'],
        //管理员表
        'chat_admin' => ['id', 'username AS adminname', '_on'=>'chat_complaint_re.admin_id=chat_admin.id'],
        //举报表
         'chat_complaint'=>['ctime','id','complaint_type_name','pic','_on'=>'chat_complaint_re.complaint_id=chat_complaint.id']
    );

}

